import java.util.Scanner;

/**
 * 写出一个程序，接受一个字符串，然后输出该字符串反转后的字符串。
 * Created by JiaJia on 2019/6/19 0019.
 */
public class HuaWei012 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        while (scanner.hasNext()){
            String str = scanner.nextLine();
            StringBuilder sb=new StringBuilder(str);
            System.out.println(sb.reverse().toString());
            System.out.println(reverseString(str));
        }
        scanner.close();
    }
    private static String reverseString(String str){
        StringBuilder builder=new StringBuilder();
        for (int i = str.length()-1; i >=0 ; i--) {
            builder.append(str.charAt(i));
        }
        return builder.toString();
    }
}